package sysu.el.array.type.algors;

import sysu.el.array.type.functors.Fun2Type;

public class ArrFLType<T> {
	public static<T> T apply(int arr_num, T[] arr, T init, Fun2Type<T> fun){
		T sum = init;
		for (int i=0; i<arr_num; i++){
			sum = fun.apply(sum, arr[i]);
		}
		return sum;
	}
}
